'   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '           N a m e : 	 D o o r L o c k _ V - S l o t _ 1 7 . t x t                                       D a t e :   2 6   M a y   2 0 2 1 
 
 '     A u t h o r s :   L e o n a r d o   D E   P A L O   P h . D .   -   R o b e r t o   F a s c i a n i   M S C . E n g . 
 
 '         S c o p e : 
 
 '   H a r d w a r e :   S t e p p e r   D r i v e r :   S L 2 2 3 6 A 
 
 '       1       2       3       4       5       6       7       8 
 
 '     O N     O F F   O N     O F F   O F F   O F F   O N     O N         =     4 A       1 6 0 0 
 
 ' 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 O p t i o n   S p e e d   9 
 
 O p t i o n   G l o b a l K e y s   E n a b l e d 
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   S l o t s 
 
 S l o t _ M o t o r Z                 =     1 
 
 S l o t _ E n a b l e M o t o r s     =   1 0 
 
 S l o t _ P E N                       =     3 
 
 S l o t _ E m e r g e n c y           =   1 1 
 
 
 
 S l o t _ S e n s o r Z _ U P         =     5 
 
 S l o t _ S e n s o r Z _ D O W N     =     6 
 
 
 
 S l o t _ L e d R                     =     7 
 
 S l o t _ L e d G                     =     8 
 
 S l o t _ L e d B                     =     9 
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   Z   l i m i t s 
 
 Z m a x                               =   2 2 0 
 
 Z m i n                               =   9 1 
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   Z   v a l u e s 
 
 Z U p                                 =   2 1 6 
 
 Z M i d d l e                         =   1 7 0 
 
 Z D o w n                             =   9 0 
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   P e n   U p   /   D o w n   s e t   u p 
 
 P e n D o w n _ V a l u e             =   9 0 7 
 
 P e n U p _ V a l u e                 =   7 7 0 
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   K e y   J o g   S p e e d 
 
 K e y J o g _ S p e e d               =   1 0 0 
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   B U T T O N S 
 
 
 
 ' B u t t o n   1   T e x t   H o m e U P 
 
 ' B u t t o n   H o m e U P   T e x t   " H O M E   U P " 
 
 ' B u t t o n   H o m e U P   C o l o r   T h i s t l e 
 
 
 
 B u t t o n   1   T e x t   H o m e D o w n 
 
 B u t t o n   H o m e D o w n   T e x t   " H O M E   D o w n " 
 
 B u t t o n   H o m e D o w n   C o l o r   T h i s t l e 
 
 
 
 B u t t o n   2   T e x t   U p 
 
 B u t t o n   3   T e x t   M i d d l e 
 
 B u t t o n   4   T e x t   D o w n 
 
 
 
 B u t t o n   6   T e x t   R u n S e q u e n c e 
 
 B u t t o n   R u n S e q u e n c e   T e x t   " R u n   S e q u e n c e " 
 
 B u t t o n   R u n S e q u e n c e   C o l o r   Y e l l o w 
 
 
 
 B u t t o n   7   T e x t   E d i t S e q u e n c e 
 
 B u t t o n   E d i t S e q u e n c e   T e x t   " E d i t   S e q u e n c e " 
 
 B u t t o n   E d i t S e q u e n c e   C o l o r   P a l e G r e e n 
 
 
 
 B u t t o n   8   T e x t   S e l e c t S e q u e n c e 
 
 B u t t o n   S e l e c t S e q u e n c e   T e x t   " S e l e c t   S e q u e n c e " 
 
 B u t t o n   S e l e c t S e q u e n c e   C o l o r   Y e l l o w 
 
 
 
 B u t t o n   1 1   T e x t   E n a b l e M o t o r s 
 
 B u t t o n   E n a b l e M o t o r s   C o l o r   T a n 
 
 
 
 B u t t o n   1 2   T e x t   D i s a b l e M o t o r s 
 
 B u t t o n   D i s a b l e M o t o r s   C o l o r   T a n 
 
 
 
 B u t t o n   1 4   T e x t     C L O S E A L L 
 
 B u t t o n   C L O S E A L L   C o l o r   R e d 
 
 
 
 B u t t o n   1 5   T e x t     E M E R G E N C Y 
 
 B u t t o n   E M E R G E N C Y   C o l o r   R e d 
 
 B u t t o n   E M E R G E N C Y   S l o t   S l o t _ E m e r g e n c y 
 
 
 
 B u t t o n   1 7   T e x t   R e d O n 
 
 B u t t o n   R e d O n   C o l o r   R e d 
 
 
 
 B u t t o n   1 8   T e x t   G r e e n O n 
 
 B u t t o n   G r e e n O n   C o l o r   G r e e n 
 
 
 
 B u t t o n   1 9   T e x t   Y e l l o w O n 
 
 B u t t o n   Y e l l o w O n   C o l o r   Y e l l o w 
 
 
 
 B u t t o n   2 0   T e x t   B l u e O n 
 
 B u t t o n   B l u e O n   C o l o r   M e d i u m B l u e 
 
 
 
 B u t t o n   2 1   T e x t   W h i t e O n 
 
 B u t t o n   G r e e n O n   C o l o r   G r e e n 
 
 
 
 B u t t o n   2 2   T e x t   R g b O f f 
 
 B u t t o n   R g b O f f   C o l o r   B l a c k 
 
 
 
 B u t t o n   2 5   T e x t   R e s e t L o g C o u n t e r 
 
 B u t t o n   R e s e t L o g C o u n t e r   T e x t   " R e s e t   L o g   c o u n t e r " 
 
 B u t t o n   R e s e t L o g C o u n t e r   C o l o r   W h i t e 
 
 
 
 B u t t o n   2 6   T e x t     O p e n L o g F i l e 
 
 B u t t o n   O p e n L o g F i l e   T e x t   " O p e n   L o g   f i l e " 
 
 B u t t o n   O p e n L o g F i l e   C o l o r   P a l e G r e e n 
 
 
 
 B u t t o n   2 7   T e x t     O p e n L o g F o l d e r 
 
 B u t t o n   O p e n L o g F o l d e r   T e x t   " O p e n   L o g   f o l d e r " 
 
 B u t t o n   O p e n L o g F o l d e r   C o l o r   Y e l l o w 
 
 
 
 B u t t o n   3 0   T e x t   P e n U p 
 
 B u t t o n   P e n U p   T e x t   " P E N   U P " 
 
 B u t t o n   P e n U p   C o l o r   L i g h t S t e e l B l u e 
 
 
 
 B u t t o n   3 1   T e x t   P e n D o w n 
 
 B u t t o n   P e n D o w n   T e x t   " P E N   D O W N " 
 
 B u t t o n   P e n D o w n   C o l o r   L i g h t S t e e l B l u e 
 
 
 
 B u t t o n   3 2   T e x t   P e n S i n g l e 
 
 B u t t o n   P e n S i n g l e   T e x t   " P E N   S I N G L E " 
 
 B u t t o n   P e n S i n g l e   C o l o r   L i g h t S t e e l B l u e 
 
 
 
 G o s u b   D i s a b l e A l l B u t t o n s 
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   R e s t o r e   v a r i a b l e s 
 
 G o s u b   R e s t o r e V a r s 
 
 G o s u b   S h o w S e q u e n c e N a m e 
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   K E Y S 
 
 K e y   P a g e u p       G o s u b   E x e c K e y s 
 
 K e y   P a g e d o w n   G o s u b   E x e c K e y s 
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   L O G   F I L E   S E T   U P 
 
 V a r i a b l e   S t r i n g   F i l e H e a d e r 
 
 V a r i a b l e   S t r i n g   L o g N a m e 
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   L O A D   E X T E R N A L   P R O G R A M S 
 
 L o a d   " T h e r e m i n o _ H A L \ T h e r e m i n o _ H A L . e x e " 
 
 L o a d   " T h e r e m i n o _ H A L \ T h e r e m i n o _ S l o t V i e w e r . e x e " 
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   T E S T   M A S T E R   P R E S E N T 
 
 F o r   v 1   =   1   T o   9 e 9 9 
 
 	 W i n d o w   S e t F o c u s 
 
 	 F o r   v 2   =   1   T o   2 0   '   < < <   t e s t i n g   f o r   2   s e c o n d s 
 
 	 	 I f   ( S l o t ( 0 )   > =   1   A n d   S l o t ( 0 )   < =   2 )   O r   K e y ( " C T R L " ) 
 
 	 	 	 E x i t   2 
 
 	 	 E n d I f 
 
 	 	 W a i t   S e c o n d s   0 . 1 
 
 	 N e x t 
 
 	 P r i n t   "   I n v a l i d   m a s t e r   n u m b e r :   "   +   S l o t ( 0 ) 
 
 	 S l o t   0   =   R e c o g n i z e 
 
 	 B e e p 
 
 N e x t 
 
 P r i n t   " " 
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   E n s u r e   m o t o r   s t o p p e d   a n d   e n a b l e 
 
 G o s u b   W a i t A l l M o t o r s 
 
 G o s u b   E n a b l e M o t o r s 
 
 
 
 I f   S l o t ( S l o t _ E m e r g e n c y )   >   5 0 0 
 
 	 G o t o   E M E R G E N C Y 
 
 E n d I f 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     S T A R T I N G   A C T I O N S 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 
 
 ' L o a d   " \ i m a g e s \ D o o L o c k   v - s l o t . j p g " 
 
 ' W a i t   S e c o n d s   1 
 
 ' L o a d   S o u n d \ g o n g . w a v 
 
 
 
 G o s u b   R e d O n 
 
 
 
 G o s u b   H o m e D o w n 
 
 
 
 ' G o s u b   M i d d l e 
 
 
 
 G o s u b   E n a b l e A l l B u t t o n s 
 
 ' L o a d   H i d e 
 
 G o s u b   G r e e n O n 
 
 O p t i o n   G l o b a l K e y s   D i s a b l e d 
 
 
 
 S t o p 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ' 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     V A R I A B L E S 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 V a r i a b l e   N u m e r i c   S l o t _ M o t o r Z 
 
 V a r i a b l e   N u m e r i c   S l o t _ S e n s o r Z _ U P 
 
 V a r i a b l e   N u m e r i c   S l o t _ S e n s o r Z _ D O W N 
 
 
 
 V a r i a b l e   N u m e r i c   S l o t _ L e d R 
 
 V a r i a b l e   N u m e r i c   S l o t _ L e d G 
 
 V a r i a b l e   N u m e r i c   S l o t _ L e d B 
 
 
 
 V a r i a b l e   N u m e r i c   S l o t _ P E N 
 
 V a r i a b l e   N u m e r i c   P e n D o w n _ V a l u e 
 
 V a r i a b l e   N u m e r i c   P e n U p _ V a l u e 
 
 
 
 V a r i a b l e   N u m e r i c   S l o t _ E n a b l e M o t o r s 
 
 V a r i a b l e   N u m e r i c   S l o t _ E m e r g e n c y 
 
 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     E M E R G E N C Y 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   E M E R G E N C Y 
 
 	 G o s u b   D i s a b l e A l l B u t t o n s 
 
 	 B u t t o n   E M E R G E N C Y   E n a b l e d 
 
 	 B u t t o n   E M E R G E N C Y   C o l o r   F l a s h i n g 7   Y e l l o w   R e d 
 
 	 F o r   v 1   =   1   T o   9 e 9 9 
 
 	 	 G o s u b   R e d O n 
 
 	 	 W a i t   S e c o n d s   0 . 4 
 
 	 	 G o s u b   R g b O f f 
 
 	 	 W a i t   S e c o n d s   0 . 4 
 
 	 	 ' L o a d   s o u n d \ A l a r m 1 0 b . w a v 
 
 	 N e x t 
 
 S t o p 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ' 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '   E N A B L E / D I S A B L E   B U T T O N S 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   E n a b l e A l l B u t t o n s 
 
 	 F o r   v 1   =   1   T o   3 2 
 
 	 	 B u t t o n   v 1   E n a b l e d 
 
 	 N e x t 
 
 R e t u r n 
 
 
 
 L a b e l   D i s a b l e A l l B u t t o n s 
 
 	 F o r   v 1   =   1   T o   3 2 
 
 	 	 B u t t o n   v 1   D i s a b l e d 
 
 	 N e x t 
 
 R e t u r n 
 
 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '   E N A B L E / D I S A B L E   M O T O R S 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   E n a b l e M o t o r s 
 
 	 S l o t ( S l o t _ E n a b l e M o t o r s )   =   1 0 0 0 
 
 R e t u r n 
 
 
 
 L a b e l   D i s a b l e M o t o r s 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t ( S l o t _ E n a b l e M o t o r s )   =   0 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     C L O S I N G   E V E N T S 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   C L O S E A L L 
 
 	 G o s u b   S a v e V a r s 
 
 	 G o s u b   D i s a b l e M o t o r s 
 
 	 G o s u b   R e d O n 
 
 	 L o a d   C l o s e A p p s 
 
 R e t u r n 
 
 
 
 L a b e l   E v e n t S t o p 
 
 	 G o s u b   S a v e V a r s 
 
 	 ' G o s u b   H o m e D o w n 
 
 	 ' W a i t   S e c o n d s   0 . 2 
 
 	 ' G o s u b   M i d d l e 
 
 	 ' W a i t   S e c o n d s   0 . 2 
 
 	 ' G o s u b   E n a b l e M o t o r s 
 
 	 G o s u b   R e d O n 
 
 	 G o s u b   E n a b l e A l l B u t t o n s 
 
 	 G o s u b   D i s a b l e M o t o r s 
 
 E n d 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ' 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     S A V E   L O A D   a n d   C L E A R   V A R S 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   S a v e V a r s 
 
 	 v 1   =   N u m C y c l e 
 
 	 v 2   =   E r r o r N u m b e r 
 
 	 S 1   =   S e q u e n c e N a m e 
 
 	 S 2   =   L o g N a m e 
 
 	 S a v e   V a r s 
 
 R e t u r n 
 
 
 
 L a b e l   R e s t o r e V a r s 
 
 	 L o a d   V a r s 
 
 	 N u m C y c l e   =   v 1 
 
 	 E r r o r N u m b e r   =   v 2 
 
 	 S e q u e n c e N a m e   =   S 1 
 
 	 L o g N a m e   =   S 2 
 
 R e t u r n 
 
 
 
 L a b e l   C l e a r V a r s 
 
 	 N u m C y c l e   =   0 
 
 	 E r r o r N u m b e r   =   0 
 
 R e t u r n 
 
 
 
 L a b e l   R e s e t L o g C o u n t e r 
 
 	 G o s u b   C l e a r V a r s 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     H O M E   Z 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   H o m e U p 
 
 	 G o s u b   D i s a b l e A l l B u t t o n s 
 
 	 G o s u b   H o m e U P _ C o r e 
 
 	 G o s u b   E n a b l e A l l B u t t o n s 
 
 R e t u r n 
 
 
 
 L a b e l   H o m e D o w n 
 
 	 G o s u b   D i s a b l e A l l B u t t o n s 
 
 	 G o s u b   H o m e D o w n _ C o r e 
 
 	 G o s u b   E n a b l e A l l B u t t o n s 
 
 R e t u r n 
 
 
 
 L a b e l   H o m e U P _ C o r e 
 
 	 G o s u b   E n a b l e M o t o r s 
 
 	 S l o t M o t o r   =   S l o t _ M o t o r Z 
 
 	 S l o t S e n s o r   =   S l o t _ S e n s o r Z _ U P 
 
 	 S p e e d S e a r c h   =   0 . 1 5 
 
 	 S p e e d R e t u r n   =   - 0 . 0 2 
 
 	 D e c l a r e d S w i t c h P o s   =   4 5 0 
 
 	 I n i t i a l P o s i t i o n   =   4 4 9 
 
 	 G o s u b   H o m e M o t o r 
 
 	 G o s u b   P r i n t V a l u e s 
 
 R e t u r n 
 
 
 
 L a b e l   H o m e D o w n _ C o r e 
 
 	 G o s u b   E n a b l e M o t o r s 
 
 	 S l o t M o t o r   =   S l o t _ M o t o r Z 
 
 	 S l o t S e n s o r   =   S l o t _ S e n s o r Z _ D O W N 
 
 	 S p e e d S e a r c h   =   - 0 . 1 5 
 
 	 S p e e d R e t u r n   =   + 0 . 0 2 
 
 	 D e c l a r e d S w i t c h P o s   =   9 0 
 
 	 I n i t i a l P o s i t i o n   =   9 2 
 
 	 G o s u b   H o m e M o t o r 
 
 	 G o s u b   P r i n t V a l u e s 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     H o m e   t h e   M o t o r ( S l o t M o t o r )   t o   t h e   S e n s o r ( S l o t S e n s o r ) 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 V a r i a b l e   N u m e r i c   S l o t M o t o r 
 
 V a r i a b l e   N u m e r i c   S l o t S e n s o r 
 
 V a r i a b l e   N u m e r i c   S p e e d S e a r c h 
 
 V a r i a b l e   N u m e r i c   S p e e d R e t u r n 
 
 V a r i a b l e   N u m e r i c   D e c l a r e d S w i t c h P o s 
 
 V a r i a b l e   N u m e r i c   I n i t i a l P o s i t i o n 
 
 
 
 L a b e l   H o m e M o t o r 
 
 	 G o s u b   E n a b l e M o t o r s 
 
 	 B u t t o n   E M E R G E N C Y   E n a b l e d 
 
 	 '   - - - - - - - - - - - - - - - - - - - - - - - - -   d e t a c h   i f   s e n s o r   i s   a c t i v e 
 
 	 I f   S l o t ( S l o t S e n s o r )   >   5 0 0   O r   K e y ( " C T R L " ) 
 
 	 	 S l o t ( S l o t M o t o r )   =   S l o t ( S l o t M o t o r )   +   S p e e d R e t u r n 
 
 	 E n d I f 
 
         '   - - - - - - - - - - - - - - - - - - - - - - - - -   s e a r c h   t h e   s e n s o r 
 
 L a b e l   S e a r c h H o m e 
 
 	 S l o t ( S l o t M o t o r )   =   S l o t ( S l o t M o t o r )   +   S p e e d S e a r c h 
 
 	 W a i t   S e c o n d s   0 . 0 0 1 
 
 	 I f   S l o t ( S l o t S e n s o r )   >   5 0 0   O r   K e y ( " C T R L " ) 
 
 	 	 S l o t ( S l o t M o t o r )   =   R e s e t 
 
 	 	 W a i t   S e c o n d s   0 . 1 
 
 	 	 S l o t ( S l o t M o t o r )   =   0 
 
 	 	 W a i t   S e c o n d s   0 . 1 
 
 	 	 G o t o   D e t a c h S e n s o r 
 
 	 E n d I f 
 
 G o t o   S e a r c h H o m e 
 
         '   - - - - - - - - - - - - - - - - - - - - - - - - -   d e t a c h   f r o m   t h e   s e n s o r 
 
 L a b e l   D e t a c h S e n s o r 
 
 	 S l o t ( S l o t M o t o r )   =   S l o t ( S l o t M o t o r )   +   S p e e d R e t u r n 
 
 	 W a i t   S e c o n d s   0 . 0 0 1 
 
 	 I f   S l o t   ( S l o t S e n s o r )   <   5 0 0 
 
 	 	 S l o t ( S l o t M o t o r )   =   R e s e t 
 
 	 	 W a i t   S e c o n d s   0 . 1 
 
 	 	 S l o t ( S l o t M o t o r )   =   D e c l a r e d S w i t c h P o s 
 
 	 	 W a i t   S e c o n d s   0 . 1 
 
 	 	 G o t o   S e t F i n a l V a l u e s 
 
 	 E n d I f 
 
 G o t o   D e t a c h S e n s o r 
 
         '   - - - - - - - - - - - - - - - - - - - - - - - - -   r e s e t   a n d   m o v e   t o   I n i t i a l P o s 
 
 L a b e l   S e t F i n a l V a l u e s 
 
 	 S l o t ( S l o t M o t o r )   =   I n i t i a l P o s i t i o n 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     F U N C T I O N S 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 V a r i a b l e   N u m e r i c   Z U p 
 
 V a r i a b l e   N u m e r i c   Z M i d d l e 
 
 V a r i a b l e   N u m e r i c   Z D o w n 
 
 
 
 L a b e l   U p 
 
 	 G o s u b   E n a b l e M o t o r s 
 
 	 S l o t ( S l o t _ M o t o r Z )   =   Z U p 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 ' G o s u b   D i s a b l e M o t o r s 
 
 R e t u r n 
 
 
 
 L a b e l   M i d d l e 
 
 	 G o s u b   E n a b l e M o t o r s 
 
 	 S l o t ( S l o t _ M o t o r Z )   =   Z M i d d l e 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 ' G o s u b   D i s a b l e M o t o r s 
 
 R e t u r n 
 
 
 
 L a b e l   D o w n 
 
 	 G o s u b   E n a b l e M o t o r s 
 
 	 S l o t ( S l o t _ M o t o r Z )   =   Z D o w n 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 ' G o s u b   D i s a b l e M o t o r s 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     P E N   U P / D O W N 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   P e n U p 
 
 	 S l o t ( S l o t _ P E N )   =   P e n U p _ V a l u e 
 
 	 W a i t   S e c o n d s   0 . 1 
 
 R e t u r n 
 
 
 
 L a b e l   P e n D o w n 
 
 	 S l o t ( S l o t _ P E N )   =   P e n D o w n _ V a l u e 
 
 	 W a i t   S e c o n d s   0 . 1 
 
 R e t u r n 
 
 
 
 L a b e l   P e n S i n g l e 
 
 	 G o s u b   W h i t e O n 
 
 	 G o s u b   P e n D o w n 
 
 	 ' L o a d   s o u n d \ C l i c k 3 . w a v 
 
 	 ' L o a d   " m e d i a \ s o u n d \ l a s e r . w a v " 
 
 	 W a i t   S e c o n d s   0 . 5 
 
 	 G o s u b   P e n U p 
 
 	 G o s u b   G r e e n O n 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     L E D   C O L O R S 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   R e d O n 
 
 	 S l o t ( S l o t _ L e d R )   =   0 
 
 	 S l o t ( S l o t _ L e d G )   =   1 0 0 0 
 
 	 S l o t ( S l o t _ L e d B )   =   1 0 0 0 
 
 R e t u r n 
 
 
 
 L a b e l   G r e e n O n 
 
 	 S l o t ( S l o t _ L e d R )   =   1 0 0 0 
 
 	 S l o t ( S l o t _ L e d G )   =   0 
 
 	 S l o t ( S l o t _ L e d B )   =   1 0 0 0 
 
 R e t u r n 
 
 
 
 L a b e l   B l u e O n 
 
 	 S l o t ( S l o t _ L e d R )   =   1 0 0 0 
 
 	 S l o t ( S l o t _ L e d G )   =   1 0 0 0 
 
 	 S l o t ( S l o t _ L e d B )   =   0 
 
 R e t u r n 
 
 
 
 L a b e l   Y e l l o w O n 
 
 	 S l o t ( S l o t _ L e d R )   =   4 0 0 
 
 	 S l o t ( S l o t _ L e d G )   =   6 0 0 
 
 	 S l o t ( S l o t _ L e d B )   =   1 0 0 0 
 
 R e t u r n 
 
 
 
 L a b e l   W h i t e O n 
 
 	 S l o t ( S l o t _ L e d R )   =   0 
 
 	 S l o t ( S l o t _ L e d G )   =   0 
 
 	 S l o t ( S l o t _ L e d B )   =   0 
 
 R e t u r n 
 
 
 
 L a b e l   R g b O f f 
 
 	 S l o t ( S l o t _ L e d R )   =   1 0 0 0 
 
 	 S l o t ( S l o t _ L e d G )   =   1 0 0 0 
 
 	 S l o t ( S l o t _ L e d B )   =   1 0 0 0 
 
 R e t u r n 
 
 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     S E Q U E N C E S 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   I n i t S e q u e n c e P a t h s 
 
 	 V a r i a b l e   S t r i n g   E d i t o r F o l d e r 
 
 	 V a r i a b l e   S t r i n g   E d i t o r A p p 
 
 	 V a r i a b l e   S t r i n g   S e q u e n c e P a t h A n d N a m e 
 
 	 V a r i a b l e   S t r i n g   S e q u e n c e N a m e 
 
 	 ' 
 
 	 E d i t o r F o l d e r   =   " . \ T h e r e m i n o _ H A L \ T h e r e m i n o _ E d i t o r \ " 
 
 	 ' 
 
 	 E d i t o r A p p   =   E d i t o r F o l d e r   +   " T h e r e m i n o _ E d i t o r . e x e " 
 
 	 ' 
 
 	 S e q u e n c e P a t h A n d N a m e   =   E d i t o r F o l d e r   +   " S e q u e n c e s \ "   +   S e q u e n c e N a m e 
 
 R e t u r n 
 
 
 
 L a b e l   R u n S e q u e n c e 
 
 	 G o s u b   D i s a b l e A l l B u t t o n s 
 
 	 B u t t o n   E d i t S e q u e n c e   E n a b l e d 
 
 	 B u t t o n   O p e n L o g F i l e   E n a b l e d 
 
 	 B u t t o n   O p e n L o g F o l d e r   E n a b l e d 
 
 	 B u t t o n   C L O S E A L L   E n a b l e d 
 
 	 G o s u b   I n i t S e q u e n c e P a t h s 
 
 	 G o s u b   I n i t F i l e H e a d e r 
 
 	 B u t t o n   R u n S e q u e n c e   C o l o r   F l a s h i n g 8   Y e l l o w   O r a n g e 
 
 	 G o s u b   E n a b l e M o t o r s 
 
 	 S e q u e n c e T o E x e c u t e   =   S e q u e n c e P a t h A n d N a m e 
 
 	 F o r   v 1   =   1   T o   9 e 9 9 
 
 	 	 G o s u b   E x e c S e q u e n c e 
 
 	 	 G o s u b   U p d a t e L o g 
 
 	 N e x t 
 
 	 B u t t o n   R u n S e q u e n c e   C o l o r   Y e l l o w 
 
 R e t u r n 
 
 
 
 L a b e l   E d i t S e q u e n c e 
 
 	 G o s u b   I n i t S e q u e n c e P a t h s 
 
 	 I f   F i l e E x i s t s ( S e q u e n c e P a t h A n d N a m e ) 
 
 	 	 L o a d   E d i t o r A p p   +   "   "   +   S e q u e n c e P a t h A n d N a m e 
 
 	 E n d I f 
 
 R e t u r n 
 
 
 
 L a b e l   S e l e c t S e q u e n c e 
 
 	 G o s u b   I n i t S e q u e n c e P a t h s 
 
 	 s 1   =   S e l e c t F i l e ( E d i t o r F o l d e r   +   " S e q u e n c e s \ " ) 
 
 	 I f   s 1   < >   " " 
 
 	 	 S e q u e n c e N a m e   =   s 1 
 
 	 	 L o g N a m e   =   " F i l e s \ L o g s \ "   +   R e p l a c e ( S e q u e n c e N a m e ,   " . s e q " ,   " . t x t " ) 
 
 	 	 G o s u b   S h o w S e q u e n c e N a m e 
 
 	 E n d I f 
 
 R e t u r n 
 
 
 
 L a b e l   S h o w S e q u e n c e N a m e 
 
 	 B u t t o n   S e l e c t S e q u e n c e   T e x t   " S e q u e n c e "   +   C R L F   +   S e q u e n c e N a m e 
 
 R e t u r n 
 
 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     S E Q U E N C E   L O A D I N G   A N D   E X E C U T I O N 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 V a r i a b l e   S t r i n g   S e q u e n c e T o E x e c u t e 
 
 V a r i a b l e   S t r i n g   S e q u e n c e 
 
 V a r i a b l e   S t r i n g   S e q u e n c e C m d 
 
 V a r i a b l e   N u m e r i c   S e q u e n c e I n d e x 
 
 V a r i a b l e   N u m e r i c   S e q u e n c e L e n g t h 
 
 
 
 L a b e l   E x e c S e q u e n c e 
 
 	 L o a d   S e q u e n c e   S e q u e n c e T o E x e c u t e 
 
 	 I f   L e n ( S e q u e n c e )   =   0 
 
 	 	 C o n t r o l s   O p e n T e x t B o x 
 
 	 	 P r i n t   C R L F   +   "   S e q u e n c e   f i l e   n o t   f o u n d :   "   +   S e q u e n c e T o E x e c u t e 
 
 	 	 B e e p 
 
 	 	 S t o p 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ' 
 
 	 E n d I f 
 
 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 	 V a r i a b l e   N u m e r i c   E x e c S e q u e n c e S t a r t T i m e 
 
 	 E x e c S e q u e n c e S t a r t T i m e   =   E l a p s e d T i m e 
 
 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 	 S e q u e n c e L e n g t h   =   G e t S e p a r a t e d S t r i n g C o u n t ( S e q u e n c e ,   C R L F ) 
 
 	 F o r   S e q u e n c e I n d e x   =   0   T o   S e q u e n c e L e n g t h - 1 
 
 	 	 S e q u e n c e C m d   =   G e t S e p a r a t e d S t r i n g ( S e q u e n c e ,   S e q u e n c e I n d e x ,   C R L F ) 
 
 	 	 S e q u e n c e C m d   =   R e p l a c e ( S e q u e n c e C m d ,   C h r ( 9 ) ,   "   " )   ' T A B S   t o   S P A C E S 
 
 	 	 S e q u e n c e C m d   =   R e m o v e C o m m e n t s ( S e q u e n c e C m d ) 
 
 	 	 S e q u e n c e C m d   =   T r i m ( S e q u e n c e C m d ) 
 
 	 	 ' 
 
 	 	 I f   S e q u e n c e C m d   < >   " " 
 
 	 	 	 P r i n t   "   E x e c u t i n g   c o m m a n d :   "   +   S e q u e n c e C m d   +   C R L F 
 
 	 	 ' 
 
 	 	 	 S e l e c t   U C a s e ( S e q u e n c e C m d ) 
 
                         '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   E n d   s e q u e n c e 
 
 	 	 	 	 C a s e   " E N D S E Q " 
 
 	 	 	 	 	 E x i t 
 
 	 	         '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   A C T I O N S 
 
 	 	 	 	 C a s e   " E N A B L E M O T O R S " 
 
 	 	 	 	 	 G o s u b   E n a b l e M o t o r s 
 
 	 	 	 	 C a s e   " D I S A B L E M O T O R S " 
 
 	 	 	 	 	 G o s u b   D i s a b l e M o t o r s 
 
 	 	 	 	 C a s e   " W A I T A L L M O T O R S " 
 
 	 	 	 	 	 G o s u b   W a i t A l l M o t o r s 
 
 	 	 	 	 C a s e   " C L O S E   A L L " 
 
 	 	 	 	 	 G o s u b   C L O S E A L L 
 
 	 	 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   L E D   C O L O R S 
 
 	 	 	 	 C a s e   " R E D O N " 
 
 	 	 	 	 	 G o s u b   R e d O n 
 
 	 	 	 	 C a s e   " G R E E N O N " 
 
 	 	 	 	 	 G o s u b   G r e e n O n 
 
 	 	 	 	 C a s e   " B L U E O N " 
 
 	 	 	 	 	 G o s u b   B l u e O n 
 
 	 	 	 	 C a s e   " Y E L L O W O N " 
 
 	 	 	 	 	 G o s u b   Y e l l o w O n 
 
 	 	 	 	 C a s e   " W H I T E O N " 
 
 	 	 	 	 	 G o s u b   W h i t e O n 
 
 	 	 	 	 C a s e   " R G B O F F " 
 
 	 	 	 	 	 G o s u b   R g b O f f 
 
 	 	 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   H O M E   U P   &   D O W N 
 
 	 	 	 	 C a s e   " H o m e U p " 
 
 	 	 	 	 	 G o s u b   H o m e U P _ C o r e 
 
 	 	 	 	 C a s e   " H o m e D o w n " 
 
 	 	 	 	 	 G o s u b   H o m e D o w n _ C o r e 
 
 	 	 	 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   P e n   a c t i o n s 
 
 	 	 	 	 C a s e   " P e n U p "                         '   m o v e   p e n   u p 
 
 	 	 	 	 	 G o s u b   P e n U p 
 
 	 	 	 	 C a s e   " P e n D o w n "                     '   m o v e   p e n   d o w n 
 
 	 	 	 	 	 G o s u b   P e n D o w n 
 
 	 	 	 	 C a s e   " P e n S i n g l e "                 '   s i n g l e   c l i c k 
 
 	 	 	 	 	 G o s u b   P e n S i n g l e 
 
 	 	 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   V I D E O 
 
 	 	 	 ' C a s e   " S T A R T V I D E O " 
 
 	 	 	 ' 	 G o s u b   S t a r t V i d e o 
 
 	 	 	 ' C a s e   " S T O P V I D E O " 
 
 	 	 	 ' 	 G o s u b   S t o p V i d e o 
 
 	 	 	 ' C a s e   " S A V E V I D E O " 
 
 	 	 	 ' 	 G o s u b   S a v e V i d e o 
 
 	 	 	 ' C a s e   " T A K E I M A G E " 
 
 	 	 	 ' 	 G o s u b   T a k e I m a g e 
 
                         '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   W i t h   p a r a m e t e r s 
 
 	 	 	 	 C a s e E l s e 
 
 	 	 	 	 	 s 1   =   G e t S e p a r a t e d S t r i n g ( S e q u e n c e C m d ,   0 ) 
 
 	 	 	 	 	 S e l e c t   U C a s e ( s 1 ) 
 
 	 	 	 	 	 	 C a s e   " M o v e M o t o r " 
 
 	 	 	 	 	 	 	 G o s u b   E n a b l e M o t o r s 
 
 	 	 	 	 	 	 	 v 1   =     G e t S e p a r a t e d S t r i n g ( S e q u e n c e C m d ,   1 ) 
 
 	 	 	 	 	 	 	 S l o t ( S l o t _ M o t o r Z )   =   v 1 
 
 	 	 	 	 	 	 	 G o s u b   W a i t A l l M o t o r s 
 
 	 	 	 	 	 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   H a n d l e r   p o s i t i o n s 
 
 	 	 	 	 	 	 C a s e   " U P " 
 
 	 	 	 	 	 	 	 G o s u b   E n a b l e M o t o r s 
 
 	 	 	 	 	 	 	 v 1   =     G e t S e p a r a t e d S t r i n g ( S e q u e n c e C m d ,   1 ) 
 
 	 	 	 	 	 	 	 S l o t ( S l o t _ M o t o r Z )   =   v 1 
 
 	 	 	 	 	 	 	 G o s u b   W a i t A l l M o t o r s 
 
 	 	 	 	 	 	 C a s e   " M I D D L E " 
 
 	 	 	 	 	 	 	 G o s u b   E n a b l e M o t o r s 
 
 	 	 	 	 	 	 	 v 1   =     G e t S e p a r a t e d S t r i n g ( S e q u e n c e C m d ,   1 ) 
 
 	 	 	 	 	 	 	 S l o t ( S l o t _ M o t o r Z )   =   v 1 
 
 	 	 	 	 	 	 	 G o s u b   W a i t A l l M o t o r s 
 
 	 	 	 	 	 	 C a s e   " D O W N " 
 
 	 	 	 	 	 	 	 G o s u b   E n a b l e M o t o r s 
 
 	 	 	 	 	 	 	 v 1   =     G e t S e p a r a t e d S t r i n g ( S e q u e n c e C m d ,   1 ) 
 
 	 	 	 	 	 	 	 S l o t ( S l o t _ M o t o r Z )   =   v 1 
 
 	 	 	 	 	 	 	 G o s u b   W a i t A l l M o t o r s 
 
 	 	 	 	 	 	 C a s e   " P A U S E " 
 
 	 	 	 	 	 	 	 W a i t   S e c o n d s   G e t S e p a r a t e d S t r i n g ( S e q u e n c e C m d ,   1 ) 
 
 	 	 	 	 	 	 C a s e E l s e 
 
 	 	 	 	 	 	 	 I f   s 1   < >   " " 
 
 	 	 	 	 	 	 	 	 C o n t r o l s   O p e n T e x t B o x 
 
 	 	 	 	 	 	 	 	 P r i n t   C R L F   +   "   U n r e c o g n i z e d   c o m m a n d :   "   +   S e q u e n c e C m d 
 
 	 	 	 	 	 	 	 	 B e e p 
 
 	 	 	 	 	 	 	 	 S t o p 	 	 	 	 	 	 	 	 ' 
 
 	 	 	 	 	 	 	 E n d I f 
 
 	 	 	 	 	 E n d S e l e c t 
 
 	 	 	 E n d S e l e c t 
 
 	 	 E n d I f 
 
 	 N e x t 
 
 	 P r i n t   S e q u e n c e T o E x e c u t e   +   "   e x e c u t e d   i n   "   +   F o r m a t ( E l a p s e d T i m e   -   E x e c S e q u e n c e S t a r t T i m e ,   " 0 . 0 0 " )   +   "   s e c o n d s " 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '       P R I N T   L O G 
 
 ' = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 V a r i a b l e   N u m e r i c   N u m C y c l e 
 
 V a r i a b l e   N u m e r i c   E r r o r N u m b e r 
 
 
 
 L a b e l   O p e n L o g F i l e 
 
 	 L o a d   L o g N a m e 
 
 R e t u r n 
 
 
 
 L a b e l   O p e n L o g F o l d e r 
 
 	 L o a d   " F i l e s \ L o g s \ " 
 
 R e t u r n 
 
 
 
 L a b e l   I n i t F i l e H e a d e r 
 
 	 F i l e H e a d e r   =   C R L F 
 
 	 F i l e H e a d e r   =   F i l e H e a d e r   +   "         T E S T   R O B O T   W 1           N u m       D u r a t . "   +   C R L F 
 
 	 F i l e H e a d e r   =   F i l e H e a d e r   +   "           D a t e       T i m e           C y c l e       s e c .   "   +   C R L F 
 
 	 F i l e H e a d e r   =   F i l e H e a d e r   +   " - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - " 
 
 	 S a v e   S t r i n g T o F i l e   F i l e H e a d e r   L o g N a m e 
 
 R e t u r n 
 
 
 
 V a r i a b l e   S t r i n g   L G 1 
 
 V a r i a b l e   N u m e r i c   S t a r t T i m e 
 
 
 
 L a b e l   U p d a t e L o g 
 
 	 N u m C y c l e   =   N u m C y c l e   +   1 
 
 	 C o n t r o l s   O p e n T e x t B o x 
 
 	 L G 1   =   " " 
 
 	 L G 1   =   L G 1   +   F o r m a t ( N o w ,   " y y y y / M M / d d   H H : m m : s s " ) 
 
 	 L G 1   =   L G 1   +   P a d L e f t ( F o r m a t ( N u m C y c l e ,   " 0 0 0 0 0 " ) ,   7 )   +   "   " 
 
 	 L G 1   =   L G 1   +   P a d L e f t ( F o r m a t ( E l a p s e d T i m e   -   S t a r t T i m e ,   " 0 . 0 0 " ) ,   6 ) 
 
 	 S a v e   S t r i n g T o F i l e   L G 1   L o g N a m e 
 
 	 P r i n t   C R L F   +   L G 1   +   C R L F   +   C R L F 
 
 	 S t a r t T i m e   =   E l a p s e d T i m e 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '       W a i t   u n t i l   a l l   m o t o r s   a r e   s t o p p e d 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   W a i t A l l M o t o r s 
 
 	 W a i t   S e c o n d s   0 . 1 
 
 	 V a r i a b l e   N u m e r i c   W M 1 
 
 	 F o r   W M 1   =   1   T o   9 e 9 9 
 
 	 	 I f   A b s ( S l o t ( S l o t _ M o t o r Z   +   1 ) )   <   0 . 0 1 
 
 	 	 	 E x i t 
 
 	 	 E n d I f 
 
 	 	 W a i t   S e c o n d s   0 . 0 0 5 
 
 	 N e x t 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     J O G   w i t h   k e y b o a r d 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 V a r i a b l e   N u m e r i c   Z m i n 
 
 V a r i a b l e   N u m e r i c   Z m a x 
 
 V a r i a b l e   N u m e r i c   K e y J o g _ S p e e d 
 
 
 
 L a b e l   E x e c K e y s 
 
 	 G o s u b   E n a b l e M o t o r s 
 
 	 V a r i a b l e   N u m e r i c   J o g S p e e d 
 
 	 J o g S p e e d   =   K e y J o g _ S p e e d   /   1 0 0 
 
 	 S e l e c t   T r u e 
 
 	 	 C a s e   K e y ( " S H I F T " ) 
 
 	 	 	 J o g S p e e d   =   J o g S p e e d   *   0 . 1 
 
 	 	 C a s e   K e y ( " C T R L " ) 
 
 	 	 	 J o g S p e e d   =   J o g S p e e d   *   0 . 0 1 
 
 	 	 C a s e   K e y ( " A L T " ) 
 
 	 	 	 J o g S p e e d   =   J o g S p e e d   *   0 . 0 0 1 
 
 	 E n d S e l e c t 
 
 	 
 
 	 I f   K e y ( " P a g e U p " ) 
 
 	 	 S l o t ( S l o t _ M o t o r Z )   =   L i m i t ( S l o t ( S l o t _ M o t o r Z )   +   J o g S p e e d ,   Z m i n ,   Z m a x ) 
 
 	 E n d I f 
 
 	 I f   K e y ( " P a g e D o w n " ) 
 
 	 	 S l o t ( S l o t _ M o t o r Z )   =   L i m i t ( S l o t ( S l o t _ M o t o r Z )   -   J o g S p e e d ,   Z m i n ,   Z m a x ) 
 
 	 E n d I f 
 
 	 
 
 	 G o s u b   P r i n t V a l u e s 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     P R I N T   C O O R D I N A T E S 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   P r i n t V a l u e s 
 
 	 C o n t r o l s   O p e n T e x t B o x 
 
 	 s 1   =               " D e s t Z = "   +   F o r m a t ( S l o t ( S l o t _ M o t o r Z ) ,   " 0 . 0 0 0 " ) 
 
 	 P r i n t   C R L F   +   s 1 
 
 R e t u r n 
 
 
 
 
 
 ' E X E C   S i n 2   =   S i n ( 3 3 ) 
 
 